
// -----------------------------------------------------------------------------

#include "stdafx.h"
#include "Win32.IO.IStream.h"
#include "Win32.Diagnostics.Log.h"

namespace Kif
{
namespace Win32
{
namespace IO
{

StreamTextReader *StreamTextReader::OpenTextReader(TCHAR *filePath)
{
   static TCHAR *func = L"StreamTextReader::openTextReader";

   StreamTextReader *pReader = NULL;
   lastHResult = SHCreateStreamOnFile(filePath, STGM_READ, &pFileStream);
   if (lastHResult != S_OK)
   {
      Kif::Win32::Diagnostics::Log::WriteMessage(
         func, L"Error opening XML document, error %08.8lx", lastHResult);
      pReader = NULL;
   }
   else
      pReader = this;

   return pReader;
}  // end of openTextReader

}  // end of Kif::Win32::IO
}  // end of Kif::Win32
}  // end of Kif

